<?php
/**
*@作者:MissZhang
*@邮箱:<787727147@qq.com>
*@创建时间:2021/7/3 下午2:17
*@说明:商品规格表
*/
namespace app\common\model;
use think\Model;

class Spec extends Model
{
    protected $pk = "id";
    // 关闭时间戳自动写入
    protected $autoWriteTimestamp = false;
    public function getPkAttr() {
        return $this->pk;
    }
    public function specItem()
    {
        return $this->hasMany(SpecItem::class,'spec_id','id')->order('order_index asc');
    }
}